package ru.aslanov.schedule.model;

import com.google.appengine.api.datastore.Blob;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import java.util.Date;

/**
 * Created by IntelliJ IDEA.
 * Created: Feb 16, 2010 7:01:42 PM
 *
 * @author Sergey Aslanov
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Document extends Entity {
    @Persistent
    private Blob data;    
    @Persistent
    private String type;
    @Persistent
    private Date created;

    public Document() {
    }

    public Document(byte[] data, String type) {
        this.data = new Blob(data);
        this.type = type;
        this.created = new Date();
    }

    public Blob getData() {
        return data;
    }

    public String getType() {
        return type;
    }

    public Date getCreated() {
        return created;
    }
}
